    var threeSumClosest = function (nums = [], target) {
        let i = 0
        let mininum
        let len = nums.length
        while (i < len) {
            let L = i + 1,
                R = len - 1
            while (L < R) {
                let sum = nums[i] + nums[L] + nums[L + 1]
                // console.log('sum==> ', sum)
                // console.log('target ==> ', target)
                let miniv = sum - target
                // console.log('miniv ==> ', miniv)
                // console.log('(miniv !== 0 && mininum !== 0 && miniv < 0 ? 0 - miniv : miniv) ==> ', (miniv !== 0 &&
                //     mininum !== 0 && miniv < 0 ? 0 - miniv : miniv))
                // console.log('mininum ==> ', mininum)
                if (!mininum) {
                    mininum = sum
                } else {
                    if (target >= 0) {
                        // console.log('sum ==> ', sum, target, mininum)
                        // console.log('target - sum ==> ', target - sum)
                        // console.log('target - mininum ==> ', target - mininum)
                        // console.log('sum小于零 ==> ', target - sum > target - mininum)
                        // console.log('sum < 0==> ', sum < 0)
                        // console.log('sum < 0 ? target - sum < target - mininum : target - sum > target - mininum ==> ', sum < 0 ? target - sum < target - mininum : target - sum > target - mininum)
                        mininum = sum < 0 ? target - sum < target - mininum : target - sum > target - mininum ?
                            mininum : sum
                    }
                    // console.log('target ==> ', target)
                    if (target < 0) {
                        mininum = sum > mininum ? mininum : sum
                    }
                }

                L++
            }
            i++
        }

        return mininum
    };


    console.log('threeSumClosest ==> ', threeSumClosest([-1, 2, 1, -4], 1))
    // console.log('threeSumClosest ==> ', threeSumClosest([1, 1, -1], 2))
    // console.log('threeSumClosest ==> ', threeSumClosest([1, 1, 1, 0], -100))
    // console.log('threeSumClosest ==> ', threeSumClosest([0, 2, 1, -3], 1))